﻿@model EnetaMvc.Web.Models.BlogPostDetailsModel
@using System.Configuration
@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_NewsLayout.cshtml";
}

<div class="blog-head"> 
    <h2 style="margin: 0px;padding: 0px"><a href="@Url.Content("~/news/blogs/details/" + Model.Blog.Id)">@Model.Blog.Name</a></h2>
	@*<ul class="small-menu">
		<li class="first-link"><a href="#">Eelmine</a></li>
		<li class="last-link"><a href="#">Järgmine</a></li>
	</ul>*@
</div>

<div class="comentaries-area">
	<div class="user-info">
		<div class="blog-foto"> <a href="@Url.Content("~/profiles/details/" + Model.Blog.CreatedById)"><img alt="@Model.Blog.CreatedByUserName" src="@Html.GetProfileUrl(Model.Blog.CreatedById)" width="32" height="32" /></a> </div>
		<div class="user-main"> <a href="@Url.Content("~/profiles/details/" + Model.Blog.CreatedById)">@Model.Blog.CreatedByUserName</a> <span>@Model.Post.Created.ToShortDateString()</span> </div>
	</div>

    <h2><a href="@Request.RawUrl">@Model.Post.Title</a></h2>

    <p>@Html.Raw(Model.Post.Body)
        <a href="@Model.Post.InfoSourceUrl" class="more-info">@Resources.EnetaMvc.ReadMoreFromAuthorsBlog</a></p>

    @if(User.IsInRole("Administrator"))
    {
        <p>&nbsp;</p>
        <form action="@Url.Action("ContentAction", new { id = Model.Post.Id })" method="get">
        @Html.Partial("_TagEditor", Model.Post.Tags)

        <div class="enter-information">
            <fieldset>
                <div class="info-row">
                    <div class="title">
                        <h5>@Resources.EnetaMvc.PublishState</h5>
                    </div>
                    <div class="information-main">
                        <span>@Model.Post.PublishStateName</span>
                    </div>
                </div>
                <div class="info-row">
                    <div class="title">
                        <h5>Keeldumise põhjus</h5>
                    </div>
                    <div class="information-main">
                        <textarea rows="5" cols="20" name="comment"></textarea>
                    </div>
                </div>
                <div class="submit">
                    <input type="submit" value="@Resources.EnetaMvc.Reject" name="actionName" />
                    <input type="submit" value="@Resources.EnetaMvc.Approve" name="actionName" />
                </div>
            </fieldset>
            
        </div>
        </form>
        <p>&nbsp;</p>
    }

    @*<ul class="tags">
		<li><a href="#">äri</a>,</li>
		<li><a href="#">ettevõtlus</a>,</li>
		<li><a href="#">sündmus</a>,</li>
		<li><a href="#">haridus</a>,</li>
		<li><a href="#">BizTalk</a></li>
	</ul>*@
	
    @{ Html.RenderPartial("_Comments", Model.Post.Comments); }
</div>

@{ Html.RenderPartial("_AddComment", Model.Post.Id); }

<div class="lisa-kommentar">
    @if(Session["UserId"] != null)
    {
	<div class="slide-box logged-in">
		<div class="slide-box-center">
			<div class="slide-box-bottom"> <a class="close" href="#">close</a>
				<div>
					<p>Lembit, <a href="#">kirjuta uudis</a> või <a href="#">lisa oma blogi</a>.</p>
				</div>
			</div>
		</div>
	</div>
    
	<ul id="profile-nav" class="bottom">
		<li> <span class="open-submenu">&nbsp;</span> <a href="#">Lisa uudis</a>
			<div>
				<ul>
					<li><a href="#">Lisa ajakiri</a></li>
					<li><a href="#">Lisa raamat</a></li>
					<li><a href="#">Lisa blogi</a></li>
					<li><a href="#">Lisa firma</a></li>
				</ul>
			</div>
		</li>
	</ul>
    }
    else 
    {
        
    }
</div>

<div class="blogs-menu">
	<ul>
		<li><a href="@Url.Content("~/")">@ConfigurationManager.AppSettings["PortalName"]</a></li>
        <li>@Resources.EnetaMvc.News</li>
        <li><a href="@Url.Content("~/news/blogs/posts/")">@Resources.EnetaMvc.Blogs</a></li>
        <li> <a href="@Url.Content("~/news/blogs/details/" + Model.Blog.Id)"> <img alt="@Model.Blog.CreatedByUserName" src="@Html.GetProfileUrl(Model.Blog.CreatedById, 16)" width="16" height="16" /> <span>@Model.Blog.Name</span> </a> </li>	
	</ul>
</div>
